package org.wsff.tools.api.gateway.core;

import java.io.Serializable;

import org.wsff.tools.api.gateway.error.ProxyException;

/**
 * Proxy 服务代理类，具体业务逻辑则需实现该接口
 * @author ryan
 * @version Id: ProxyInvoker.java, v 0.1 2022-01-19 14:04 ryan Exp $$
 */
public interface ProxyInvoker<Request extends Serializable, Response extends Serializable> {

    /**
     * 代理执行
     *
     * @param context the gateway context, include request, response, proxy name.
     * @return 业务响应 response
     * @throws ProxyException 代理异常
     */
    Response invoke(GatewayContext<Request, Response> context) throws ProxyException;
}
